<template>
	<div class="container">
	    <div class="login-form">
	      <div class="text" >找回密码</div>
	      <div class="form-item">
	        <input type="text"  v-model="form.account" placeholder="输入邮箱">
			<input type="text"  v-model="form.name" placeholder="输入昵称">
			<input type="button" value="点击邮箱发送密码" @click="sendPsw()"/>
	      </div>
	      <div class="other">
	        <router-link to="/userlogin">去登录</router-link>
	      </div>
	    </div>
	  </div>
</template>

<script>
	import router from "@/router";

  export default{
		data(){
			return{
				 form:{
					 account:"1503608495@qq.com",
           name:"",
				 },
			}
		},
		methods: {
      sendPsw() {
        //      createYzm
        if (this.form.account.length == 0) {
          this.$message({message: "邮箱不能为空！", type: 'warning'});
          return;
        }
        if (this.form.name.length == 0) {
          this.$message({message: "昵称不能为空！", type: 'warning'});
          return;
        }
        this.$http.get("userApi/userCtl/sendPsw?account=" + this.form.account + "&name=" + this.form.name).then((resp) => {
          if (resp.data.code == 200) {
            this.$message({message: resp.data.message, type: 'success'});
          }
        })
      },
    }
	}
</script>

<style src="../../assets/css/userlogin.css" scoped></style>
